package com.jingding.procurement.controller;

import com.jingding.procurement.pojo.vo.MaterialClassVO;
import com.jingding.procurement.pojo.vo.MaterialVO;
import com.jingding.procurement.service.MaterialEnquiryService;
import com.jingding.procurement.web.JsonResult;
import com.jingding.procurement.web.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.expression.spel.ast.NullLiteral;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/U8/EAM")
public class MaterialEnquiryController {

    @Autowired
    private MaterialEnquiryService materialEnquiryService;


    //查询物料接口
    @GetMapping("GetMaterialInfo")
    public PageResult selMaterial(String invcode/*物料编码*/,String invname/*物料名称*/,String invstd/*型号规格*/,String invccode/*物料分类编码*/,String invcname/*物料分类名称*/,
                                  Integer page/*页码*/, Integer rows/*条数*/){
        PageResult pageResult = materialEnquiryService.selMaterial(invcode,invname,invstd,invccode,invcname,page,rows);
        return pageResult;
    }
    //查询物料分类接口
    @GetMapping("GetMaterialCate")
    public List<MaterialClassVO> selMaterialClass(){
        List<MaterialClassVO>  materialClassVO = materialEnquiryService.selMaterialClass();
        return materialClassVO;
    }




}
